package com.yh.csx.crm.core.enums;

/**
 * ApproveEnum class
 * 审批类型：01：新建客户，02：固定额度变更，03：基本客户信息修改，04：临时额度修改，05：扩展公司
 * @author huyalin
 * @date 2019/2/20
 */
public enum ApprovalTypeEnum {
    NEW("01", "新建客户"),
    CREDIT("02", "固定额度调整"),
    MODIFY("03", "基本信息变更"),
    TEMP_CREDIT("04", "临时额度调整"),
    EXT_COMPANY("05","扩展公司");

    private String code;
    private String name;

    ApprovalTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(String code) {
        for (ApprovalTypeEnum approvalTypeEnum: ApprovalTypeEnum.values()) {
            if (approvalTypeEnum.getCode().equals(code)) {
                return approvalTypeEnum.getName();
            }
        }
        return null;
    }
}
